import request from '@/utils/request';
const hostUrl = process.env.BASE_API || '';
export function loginByUsername(username, password) {
    return request({
        url: `${hostUrl}/user/login?userName=${username}&password=${password}`,
        method: 'post'
    });
}
export function register({userName, password, verifpassWord}) {
    // const data = {
    //     userName,
    //     password,
    //     verifpassWord
    // };
    return request({
        url: `${hostUrl}/user/register?userName=${userName}&password=${password}&verifpassWord=${verifpassWord}`,
        method: 'post'
    });
}

export function logout() {
    return request({
        url: '/login/logout',
        method: 'post'
    });
}

export function getUserInfo(token) {
    return request({
        url: '/user/info',
        method: 'get',
        params: { token }
    });
}

